using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TONLI.Domain.RightManager;

namespace TONLI.TJOA.Anquan {
    public partial class AQK_AQXXBMTJ : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                ASPxDateEdit1.Value = DateTime.Now.AddDays(-1).Date;
                ASPxDateEdit2.Value = DateTime.Now.Date;
                InitData();
            }

        }



        private void InitData()
        {
            Hashtable ha = new Hashtable();

            DateTime dt1 = DateTime.Now.Date;
            DateTime dt2 = DateTime.Now.Date;
            if (ASPxDateEdit1.Text.Trim() != "")
                dt1 = Convert.ToDateTime(ASPxDateEdit1.Value);
            if (ASPxDateEdit2.Text.Trim() != "")
                dt2 = Convert.ToDateTime(ASPxDateEdit2.Value);

            //ha.Add("S1", dt1.AddHours(10));
            //ha.Add("S2", dt2.AddDays(1).AddHours(10));
            ha.Add("S1", dt1);
            ha.Add("S2", dt2.AddDays(1));

            Session["DeptDate"] = ha;
            ObjectDataSource1.Select();

        }

        protected void ASPxDateEdit1_DateChanged(object sender, EventArgs e)
        {

        }

        protected void ASPxDateEdit2_DateChanged(object sender, EventArgs e)
        {

        }

        protected void ASPxButton1_Click(object sender, EventArgs e)
        {
            InitData();
        }

        protected void ASPxButton2_Click(object sender, EventArgs e)
        {
            ASPxGridViewExporter1.WriteXlsToResponse(Server.UrlEncode(ASPxGridView1.SettingsText.Title));
        }

        protected void ASPxCallbackPanel1_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            InitData();
        }
    }
}
